package com.zfh.iterator;

import java.util.ArrayList;

public class StudentGroup implements Aggregate {
	
	private ArrayList students;
	
	public StudentGroup(int initialsize) {
		this.students = new ArrayList(initialsize);
	}
	
	public Student getStudentAt(int index) {
		return (Student) students.get(index);
	}
	
	public void appendStudent(Student student) {
		students.add(student);
	}
	
	public int getLength() {
		return students.size();
	}

	@Override
	public Iterator iterator() {
		return new StudentGroupIterator(this);
	}

}
